<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>所有游戏 - Steam游戏库</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
    {% include 'header.html' %}

    <div class="container mt-4">
        <h2>所有游戏</h2>
        <p class="text-muted">共 {{  total_count }} 个游戏 {% if current_limit != 'all' %}(仅显示前 {{ games|length }} 个){% endif %}</p>

        {% if games %}
        <div class="table-responsive">
            <table class="table table-striped table-hover">
                <thead>
                    <tr>
                        <th>图片</th>
                        <th>游戏名称</th>
                        <th>折扣</th>
                        <th>最终价格</th>
                        <th>上架时间</th>
                        <th>评价等级</th>
                        <th>游戏平台</th>
                    </tr>
                </thead>
                <tbody>
                    {% for game in games %}
                    <tr onclick="window.location.href='{{ game['游戏链接'] }}'" style="cursor: pointer;">
                        <td><img src="{{ game['照片路径'] }}" alt="{{ game['游戏名称'] }}" class="img-fluid" style="width: 80px;"></td>
                        <td>{{ game['游戏名称'] }}</td>
                        <td>{% if game['折扣'] != 'N/A' %}{{ game['折扣'] }}{% else %}-{% endif %}</td>
                        <td>{{ game['最终价格'] }}</td>
                        <td>{{ game['上架时间'] }}</td>
                        <td>{% if game['评价等级'] == 'N/A' %} 未评级 {% else %} {{ game['评价等级'] }} {% endif %}</td>
                         <td>{{ game['游戏平台'] }}</td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
        {% else %}
        <div class="alert alert-info">
            没有找到任何游戏。
        </div>
        {% endif %}

        {% if current_limit != 'all' and games|length < total_count %}
        <div class="text-center mt-4">
            <a href="{{ url_for('all_games', limit='all') }}" class="btn btn-primary">查看更多</a>
        </div>
        {% endif %}
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html> 